home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
m
/
muiv3.1cracked.lha
/
MUI
/
Developer
/
ExtClasses
/
MCC_UserData
/
ShowUserData.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-22
|
2KB
|
87 lines
/*
** Little tool to show the UserData custom class.
*/
#include "demo.h"
#include "UserData_mcc.h"
int main(int argc,char *argv[])
{
Object *app,*window,*sasg;
init();
app = ApplicationObject,
MUIA_Application_Title , "ShowUserData",
MUIA_Application_Version , "$VER: ShowUserData 12.9 (21.11.95)",
MUIA_Application_Copyright , "©1994 by Stefan Stuntz",
MUIA_Application_Author , "Stefan Stuntz",
MUIA_Application_Description, "Show the UserData custom class",
MUIA_Application_Base , "SHOWUSERDATA",
SubWindow, window = WindowObject,
MUIA_Window_Title, "Show the UserData public custom class",
MUIA_Window_ID , MAKE_ID('S','A','S','G'),
WindowContents, VGroup,
Child, sasg = MUI_NewObject(MUIC_UserData,
MUIA_UserData_First , "Jo",
MUIA_UserData_Name , "User",
MUIA_UserData_Street , "Fakestreet 12",
MUIA_UserData_City , "Faketown, FT 1234",
MUIA_UserData_Country, "Wonderland",
MUIA_UserData_Phone , "+1-234-567-8901",
MUIA_UserData_EMail , "jouser@fake.wonder.land",
TAG_DONE),
End,
End,
End;
if (!app)
fail(app,"Failed to create Application.");
/*
** Install notification events...
*/
DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
/*
** This is the ideal input loop for an object oriented MUI application.
** Everything is encapsulated in classes, no return ids need to be used,
** we just check if the program shall terminate.
** Note that MUIM_Application_NewInput expects sigs to contain the result
** from Wait() (or 0). This makes the input loop significantly faster.
*/
set(window,MUIA_Window_Open,TRUE);
{
ULONG sigs = 0;
while (DoMethod(app,MUIM_Application_NewInput,&sigs) != MUIV_Application_ReturnID_Quit)
{
if (sigs)
{
sigs = Wait(sigs | SIGBREAKF_CTRL_C);
if (sigs & SIGBREAKF_CTRL_C) break;
}
}
}
set(window,MUIA_Window_Open,FALSE);
/*
** Shut down...
*/
fail(app,NULL);
}